package applications.away3d {
	import display3d.away3d.Luigi3D;
	import display3d.away3d.Mario3D;
	import jazztures.plugins.away3d.Skeleton3D;


	[SWF(width=1000, height=800, frameRate=60, backgroundColor=0xFFFFFF)]
	public class KinectMarioAway3D extends KinectSkeletonAway3D
	{
		private var totalSkeletons:int = 0;
		
		public function KinectMarioAway3D()
		{
			super();
		}

		override protected function createSkeleton():Object{
			if (totalSkeletons > 1) return null;
			var skeleton3D:Skeleton3D = totalSkeletons > 0 ? new Luigi3D() : new Mario3D();
			skeleton3D.z = 5000;
			world.addChild(skeleton3D);
			totalSkeletons ++;
			return skeleton3D;
		}
		
		override protected function destroySkeleton(skeleton:Object):void{
			world.removeChild(skeleton as Skeleton3D);
			totalSkeletons--;
		}
	}
}